package com.test37_反射应用;

import com.test37_反射应用.util.ObjectInstanceFactory;
import com.test37_反射应用.vo.Emp;

/**
 * 级联对象赋值
 */
public class YootkDemo_03 {
    public static final String ECHO_DATA = "empno:7886|ename:小李老师|job:沐言讲师|salary:5000.05|hiredate:2020-09-19 09:15:27"
            + "|dept.deptno:20|dept.dname:沐言教学部"
            + "|dept.company.cno:1|dept.company.cname:沐言科技";

    public static void main(String[] args) {
        Emp emp = ObjectInstanceFactory.create(Emp.class, ECHO_DATA);   // 避免向下转型
        System.out.println(emp);
        System.out.println(emp.getDept());
        System.out.println(emp.getDept().getCompany());
    }
}
